#ifndef CAMERA_H
#define CAMERA_H

#include "Constants.h"

#include <glm/glm.hpp>

using glm::vec2;
using glm::vec3;

class Camera
{
public:

	explicit Camera();
    explicit Camera(vec3 pos, vec3 look = vec3(0.0f, 0.0f, 1.0f));
	~Camera();

    void turn(vec2 movement);
    void moveForward();
    void moveBackwards();
    void strafeLeft();
    void strafeRight();

    vec3 getPos() const;
    vec3 getLook() const;
    vec3 getLookAt() const;

    float getFocalLength() const;
    float getFocusDistance() const;
    float getFocalRatio() const;
    float getFrameSize() const;

    void setPosition(vec3 pos);
    void setMovementStatus(bool status);
    void setStrafeStatus(bool status);

    void setFocalLength(float focalLength);
    void setFocusDistance(float focusDistance);
    void setFocalRatio(float focalRatio);
    void setFrameSize(float frameSize);

private:

	// Disable copying.
	Camera(Camera const& rhs);
	Camera& operator=(Camera const& rhs);

    // Functions.
    void setDiagonalSpeed();
    void setDefaultSpeed();

    // Constants.    
    static const float SENSITIVITY;
    static const float DEFAULT_SPEED;

    // Variables.    
    vec3 m_pos;
    vec3 m_look;

    float m_yRot;
    float m_xRot;

    float m_speed;

    bool m_move;
    bool m_strafe;

    // Camera parameters measured in millimetres.
    float m_focalLength;
    float m_focusDistance;
    float m_focalRatio;
    float m_frameSize;
};

#endif // CAMERA_H